home *** CD-ROM | disk | FTP | other *** search
- package com.supercede.forms;
-
- import com.supercede.beans.Support;
- import java.applet.Applet;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Graphics;
- import java.awt.Point;
- import java.awt.ScrollPane;
- import java.awt.peer.ScrollPanePeer;
- import java.io.IOException;
- import java.io.InvalidObjectException;
- import java.io.ObjectInputStream;
- import java.io.Serializable;
- import java.util.Vector;
-
- public class SuperCedeScrollPane extends ScrollPane implements SuperCedeDesignContainer, SuperCedeContainerListener, Support, Serializable {
- SuperCedeRuntimeInfo runtimeInfo = new SuperCedeRuntimeInfo();
- SuperCedeDesignInfo designInfo = new SuperCedeDesignInfo();
- transient boolean designMode = false;
- transient DesignModeListener formListener = null;
- transient Vector scContainerListeners = null;
- boolean shadowEnabled = super.isEnabled();
- Point shadowLocation = new Point(0, 0);
- int scrollbarDisplayPolicy = 0;
- private static final long serialVersionUID = 1013082004010516614L;
- private static final int _version = 1;
- private int version = 1;
-
- public final void initializeThis(Vector var1) throws IOException, ClassNotFoundException, ClassCastException, SuperCedeInvalidStateException {
- this.designInfo = null;
- this.runtimeInfo = null;
- SuperCedeHelper.runTimeConstructor(this, var1);
- ((Component)this).setLocation(this.shadowLocation);
- this.validateObject();
- }
-
- public Component[] getContainedComponents() {
- return ((Container)this).getComponents();
- }
-
- public void initializeFrom(SuperCedeContainer var1) throws ClassCastException, SuperCedeInvalidStateException {
- try {
- this.setDesignMode(((SuperCedeDesignContainer)var1).isDesignMode());
- this.setFormListener(((SuperCedeDesignContainer)var1).getFormListener());
- this.runtimeInfo = var1.getRuntimeInfo();
- this.designInfo = ((SuperCedeDesignContainer)var1).getDesignInfo();
- SuperCedeHelper.convertContainer((Container)var1, this);
- if (!this.isDesignMode()) {
- this.runtimeInfo = null;
- this.designInfo = null;
- }
- } catch (ClassCastException var3) {
- throw var3;
- }
- }
-
- public SuperCedeDesignInfo getDesignInfo() {
- return this.designInfo;
- }
-
- public SuperCedeRuntimeInfo getRuntimeInfo() {
- return this.runtimeInfo;
- }
-
- public void addComponent(Component var1, Object var2) {
- this.addComponent(var1, var2, -1);
- }
-
- public void addComponent(Component var1, Object var2, int var3) {
- this.add(var1, var2, var3);
- this.runtimeInfo.addLayoutConstraints(var1, var2);
- }
-
- public void add(Component var1, Object var2, int var3) {
- super.add(var1, var2, var3);
- if (((Component)this).isVisible() && var1 instanceof Applet) {
- ((Applet)var1).start();
- }
-
- }
-
- public void removeComponent(int var1) {
- this.removeComponent(((Container)this).getComponent(var1));
- }
-
- public void removeComponent(Component var1) {
- this.runtimeInfo.removeLayoutConstraints(var1);
- this.remove(var1);
- }
-
- public void remove(Component var1) {
- if (((Component)this).isVisible() && var1 instanceof Applet) {
- ((Applet)var1).stop();
- }
-
- super.remove(var1);
- }
-
- public boolean isEnabled() {
- return this.shadowEnabled;
- }
-
- public void setEnabled(boolean var1) {
- this.shadowEnabled = var1;
- if (!this.isDesignMode()) {
- super.setEnabled(var1);
- }
-
- }
-
- public void paint(Graphics var1) {
- if (this.formListener != null) {
- this.formListener.paint(var1);
- }
-
- super.paint(var1);
- }
-
- public void addNotify() {
- if (this.formListener != null) {
- this.formListener.setupParentHWND();
- }
-
- super.addNotify();
- if (this.formListener != null) {
- this.formListener.addedPeer();
- }
-
- }
-
- public void removeNotify() {
- if (this.formListener != null) {
- this.formListener.removingPeer();
- }
-
- super.removeNotify();
- }
-
- public Object getLayoutConstraints(Component var1) {
- return this.runtimeInfo.getLayoutConstraints(var1);
- }
-
- public Object getLayoutConstraints(int var1) {
- return this.getLayoutConstraints(((Container)this).getComponent(var1));
- }
-
- public void setDesignMode(boolean var1) {
- this.designMode = var1;
- }
-
- public boolean isDesignMode() {
- return this.designMode;
- }
-
- public void setFormListener(DesignModeListener var1) {
- this.formListener = var1;
- }
-
- public DesignModeListener getFormListener() {
- return this.formListener;
- }
-
- public void doPostSerializeProcessing(boolean var1) {
- Container var2 = ((Component)this).getParent();
- if (var2 instanceof SuperCedeContainer) {
- ((SuperCedeContainer)var2).addSuperCedeContainerListener(this);
- }
-
- }
-
- public void containerShutdown(SuperCedeContainerEvent var1) {
- if (this.scContainerListeners != null) {
- synchronized(this){}
-
- Vector var2;
- try {
- var2 = (Vector)this.scContainerListeners.clone();
- } catch (Throwable var5) {
- throw var5;
- }
-
- for(int var3 = 0; var3 < var2.size(); ++var3) {
- ((SuperCedeContainerListener)var2.elementAt(var3)).containerShutdown(var1);
- }
- }
-
- }
-
- public void addSuperCedeContainerListener(SuperCedeContainerListener var1) {
- synchronized(this){}
-
- try {
- if (this.scContainerListeners == null) {
- this.scContainerListeners = new Vector();
- }
-
- this.scContainerListeners.addElement(var1);
- } catch (Throwable var4) {
- throw var4;
- }
-
- }
-
- public void removeSuperCedeContainerListener(SuperCedeContainerListener var1) {
- synchronized(this){}
-
- try {
- this.scContainerListeners.removeElement(var1);
- } catch (Throwable var4) {
- throw var4;
- }
-
- }
-
- public void setVisible(boolean var1) {
- if (!var1) {
- SuperCedeHelper.setAppletVisibility(this, this.isDesignMode(), false);
- }
-
- super.setVisible(var1);
- if (var1) {
- SuperCedeHelper.setAppletVisibility(this, this.isDesignMode(), true);
- }
-
- }
-
- public int getScrollbarDisplayPolicy() {
- return this.scrollbarDisplayPolicy;
- }
-
- public void setScrollbarDisplayPolicy(int var1) {
- if (var1 != this.scrollbarDisplayPolicy) {
- switch (var1) {
- case 0:
- case 1:
- case 2:
- this.scrollbarDisplayPolicy = var1;
- Object var2 = ((Component)this).getTreeLock();
- synchronized(var2){}
-
- try {
- if (((Component)this).getPeer() != null) {
- this.removeNotify();
- this.addNotify();
- ((Container)this).invalidate();
- }
- } catch (Throwable var4) {
- throw var4;
- }
-
- return;
- default:
- throw new IllegalArgumentException("illegal scrollbar display policy value");
- }
- }
- }
-
- public int getHScrollbarHeight() {
- int var1 = 0;
- if (this.getScrollbarDisplayPolicy() != 2) {
- ScrollPanePeer var2 = (ScrollPanePeer)((Component)this).getPeer();
- if (var2 != null) {
- var1 = var2.getHScrollbarHeight();
- }
- }
-
- return var1;
- }
-
- public int getVScrollbarWidth() {
- int var1 = 0;
- if (this.getScrollbarDisplayPolicy() != 2) {
- ScrollPanePeer var2 = (ScrollPanePeer)((Component)this).getPeer();
- if (var2 != null) {
- var1 = var2.getVScrollbarWidth();
- }
- }
-
- return var1;
- }
-
- private void readObject(ObjectInputStream var1) throws IOException, ClassNotFoundException {
- var1.defaultReadObject();
-
- try {
- SuperCedeHelper.doDeserializationProcessing(this);
- } catch (SuperCedeInvalidStateException var2) {
- }
- }
-
- public void validateObject() throws InvalidObjectException {
- }
- }
-